<template>
	<view class="adup-route-bz">
		<u-form :model="fm.ps" :ref="fm.fname" :rules="rules" :error-type="['toast']">
			<view class="my-fm" :style="{'padding-top': '0rpx'}">
				<view class="f-item no-box" :style="{'padding-top': '85rpx'}">
					<view class="f-item-title"
						:style="{'position': 'fixed', 'top': '-4rpx', 'width': 'calc(100% - 50rpx)', 'padding-left': '20rpx'}">
						<label class="r-l-icon" :style="{'background': '#ff6300', 'left': '0rpx'}"></label>
						添加订单
						<view class="r-r-con">
							<u-button :hover-class="'none'" :custom-style="fm.sb.cancleBtnSy" @click="closeMd">
								<u-icon name="arrow-leftward" color="#ff6300"></u-icon>返回
							</u-button>
							<u-button :ripple="true" :hover-class="'none'" :custom-style="fm.sb.okBtnSty"
								:loading="fm.sb.load" @click="submitFm">
								<u-icon name="edit-pen-fill" color="#fff"></u-icon>提交
							</u-button>


						</view>
					</view>


					<u-form-item>
						<view class="i-row">
							<view class="r-title">客户名称:</view>
							<view class="r-con">
								<u-input style="width: 450rpx;" type='select' @click="findComboCusList_btn"
									v-model="fm.ps2.useCarCompanyname" :input-align="'right'" :clearable="false"
									:custom-style="{'color': '#00C3CE'}" :placeholder="'请选择客户'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item>
						<view class="i-row">
							<view class="r-title">负责人:</view>
							<view class="r-con">
								<u-input style="width: 450rpx;" type='select' @click="getAllDutyOfCustomList_btn"
									v-model="fm.ps2.useCarDutyUsername" :input-align="'right'" :clearable="false"
									:custom-style="{'color': '#00C3CE'}" :placeholder="'请选择负责人'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item>
						<view class="i-row">
							<view class="r-title">业务员:</view>
							<view class="r-con">
								<u-input style="width: 450rpx;" type='select' @click="getServiceMansList_btn"
									v-model="fm.ps2.getServiceMansname" :input-align="'right'" :clearable="false"
									:custom-style="{'color': '#00C3CE'}" :placeholder="'请选择业务员'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item>
						<view class="i-row">
							<view class="r-title">预约人数:</view>
							<view class="r-con">
								<u-input v-model="fm.ps.personNum" :type="'digit'" :input-align="'right'"
									:clearable="false" :custom-style="{'color': '#00C3CE'}" :placeholder="'请输入预约人数'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item v-if='perfect_info_data.radio_value !="拼车"'>
						<view class="i-row">
							<view class="r-title">指定车型:</view>
							<view class="r-con">
								<u-input type='select' @click="needSeats_btn" v-model="fm.ps2.needSeatsname"
									:input-align="'right'" :clearable="false" :custom-style="{'color': '#00C3CE'}"
									:placeholder="'请选择指定车型'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item v-if='carConfignameList_off && perfect_info_data.radio_value !="拼车"'>
						<view class="i-row">
							<view class="r-title">车辆配置:</view>
							<view class="r-con">
								<u-input style="width: 450rpx;" type='select' @click="carConfigname_btn"
									v-model="fm.ps2.carConfigname" :input-align="'right'" :clearable="false"
									:custom-style="{'color': '#00C3CE'}" :placeholder="'请选择车辆配置'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item>
						<view class="i-row">
							<view class="r-title">用车费用:</view>
							<view class="r-con">
								<u-input v-model="fm.ps.price" :type="'digit'" :input-align="'right'" :clearable="false"
									:custom-style="{'color': '#00C3CE'}" :placeholder="'请输入用车费用'" />
							</view>
							<label style="margin-right: 10rpx;" class="i-r-text">元</label>
							<u-button v-if='perfect_info_data.type !=2' @click="calculate_btn" size="mini"
								type="warning">自动计算</u-button>
						</view>
					</u-form-item>
					<u-form-item prop="cusName">
						<view class="i-row">
							<view class="r-title">联系人姓名:</view>
							<view class="r-con">
								<u-input v-model="fm.ps.cusName" :type="'text'" :input-align="'right'"
									:clearable="false" :custom-style="{'color': '#00C3CE'}" :placeholder="'请输入联系人姓名'" />
							</view>
							<view v-if='perfect_info_data.radio_value !="拼车"' style="width: 5%;margin-left: 10px;">
								<u-icon @click="add_people_btn(index)" name="plus-circle-fill" color="#00aa00"
									size="40">
								</u-icon>
							</view>

						</view>
					</u-form-item>
					<u-form-item prop="cusMobile">
						<view class="i-row">
							<view class="r-title">联系人电话:</view>
							<view class="r-con">
								<u-input v-model="fm.ps.cusMobile" :type="'tel'" :input-align="'right'"
									:clearable="false" :custom-style="{'color': '#00C3CE'}" :placeholder="'请输入联系人电话'" />
							</view>
						</view>
					</u-form-item>

					<view v-if="add_people_list.length > 0 && perfect_info_data.radio_value !='拼车'">
						<u-form-item v-for="(item,index) in add_people_index" :key="index" borderBottom
							leftIcon="phone-fill" :leftIconStyle="{'color': '#ff9900'}">
							<view style="display: flex;align-items: center;">
								<u-input type="text" v-model="add_people_list[index].name" disabledColor="#ffffff"
									placeholder="联系人姓名"></u-input>
								<u-input type="tel" v-model="add_people_list[index].mobile" disabledColor="#ffffff"
									placeholder="联系人电话"></u-input>
								<view style="width: 5%;margin-left: 10px;">
									<u-icon @click="add_people_delbtn(index)" name="close-circle-fill" color="#ff0000"
										size="40">
									</u-icon>
								</view>
							</view>
						</u-form-item>
					</view>
					<!--  -->
					<u-form-item prop="riseSignPrice">
						<view class="i-row">
							<view class="r-title">举牌接机:</view>
							<view class="r-con">
								<u-input v-model="fm.ps.riseSignPrice" :type="'number'" :input-align="'right'"
									:clearable="false" :custom-style="{'color': '#00C3CE'}"
									:placeholder="'请输入举牌接机价格'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item prop="wayEatPrice">
						<view class="i-row">
							<view style="width: 300rpx;" class="r-title">中途吃饭或签合同:</view>
							<view class="r-con">
								<u-input v-model="fm.ps.wayEatPrice" :type="'number'" :input-align="'right'"
									:clearable="false" :custom-style="{'color': '#00C3CE'}"
									:placeholder="'中途吃饭或签合同价格'" />
							</view>
						</view>
					</u-form-item>

					<u-form-item prop="isBaitui">
						<view class="i-row">
							<view class="r-title">是否百推订单:</view>
							<view class="r-con">
								<u-input @click="isBaitui_btn" v-model="fm.ps2.isBaituiname" :type="'select'"
									:input-align="'right'" :clearable="false" :custom-style="{'color': '#00C3CE'}"
									:placeholder="'是否百推订单'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item prop="baituiSignatoryPhone" v-if="fm.ps.isBaitui == 1">
						<view class="i-row">
							<view style="width: 300rpx;" class="r-title">百推签单员电话:</view>
							<view class="r-con">
								<u-input v-model="fm.ps.baituiSignatoryPhone" :type="'tel'" :input-align="'right'"
									:clearable="false" :custom-style="{'color': '#00C3CE'}"
									:placeholder="'请输入百推签单员电话'" />
							</view>
						</view>
					</u-form-item>
					<!--  -->
					<u-form-item>
						<view class="i-row-textarea">
							<view class="r-title">驾驶员备注</view>
							<view class="r-con">
								<u-input v-model="fm.ps.driverRemark" :type="'textarea'"
									:custom-style="{'color': '#00C3CE'}" :placeholderStyle="'color: #f000000;'"
									:clearable="false" :auto-height="true" :height="200" :maxlength="200"
									:placeholder="'请填写客户备注，最多输入200个字（选填）'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item>
						<view class="i-row-textarea">
							<view class="r-title">业务员备注</view>
							<view class="r-con">
								<u-input v-model="fm.ps.serviceManRemark" :type="'textarea'"
									:custom-style="{'color': '#00C3CE'}" :placeholderStyle="'color: #f000000;'"
									:clearable="false" :auto-height="true" :height="80" :maxlength="200"
									:placeholder="'请填写业务员备注，最多输入200个字（选填）'" />
							</view>
						</view>
					</u-form-item>
					<u-form-item>
						<view class="i-row-textarea">
							<view class="r-title">客户备注</view>
							<view class="r-con">
								<u-input v-model="fm.ps.remark" :type="'textarea'" :custom-style="{'color': '#00C3CE'}"
									:placeholderStyle="'color: #f000000;'" :clearable="false" :auto-height="true"
									:height="100" :maxlength="200" :placeholder="'请填写客户备注，最多输入200个字（选填）'" />
							</view>
						</view>
					</u-form-item>






				</view>
			</view>
		</u-form>

		<template>
			<!-- <u-select :label-name='"cusCompanySimpleName"' :value-name='"id"' :list="findComboCusList"
				v-model="findComboCusList_show" mode="single-column" @confirm="findComboCusList_confirm"></u-select> -->
			<u-select :label-name='"name"' :value-name='"id"' :list="isBaitui_list" v-model="isBaitui_off"
				mode="single-column" @confirm="isBaitui_confirm"></u-select>

			<u-select :label-name='"realName"' :value-name='"ftUserId"' :list="getAllDutyOfCustomList"
				v-model="getAllDutyOfCustomList_show" mode="single-column"
				@confirm="getAllDutyOfCustomList_confirm"></u-select>

			<u-select :label-name='"realName"' :value-name='"id"' :list="getServiceMansList"
				v-model="getServiceMansList_show" mode="single-column" @confirm="getServiceMansList_confirm"></u-select>

			<u-select :label-name='"label"' :value-name='"id"' :list="needSeatsList" v-model="needSeats_show"
				mode="single-column" @confirm="needSeats_confirm"></u-select>
			<u-select :label-name='"text"' :value-name='"val"' :list="carConfignameList" v-model="carConfigname_show"
				mode="single-column" @confirm="carConfigname_confirm"></u-select>
			<u-modal @confirm='modal_confirm' title="提示" cancel-text='返回' confirm-text='下单' :show-cancel-button='true'
				v-model="modal_show" :content="modalcontent"></u-modal>
			<view class="picker_css" v-if="findComboCusList_show">
				<u-search style="width: 20vw;" v-model="curval1" :shape="'square'" :bgColor="'#fff'"
					:borderColor="'#00c3ce'" :placeholder="'请输入客户关键字搜索并选择'" :focus="false" :height="'80rpx'"
					:color="'#00c3ce'" :maxlength="30" :margin="'16rpx'" :show-action="true" :action-text="'返回'"
					@change="onChange" @custom="picker_closeMd"></u-search>
				<view class="list-content">
					<view class="point-item" v-for="(it, index) in findComboCusList" :key="index" :data-obj="it"
						@click="picker_confirm1(it)">
						<view class="point-name">
							<u-icon name="account-fill" :color="'#00c3ce'" size="20"></u-icon>
							{{it.cusCompanySimpleName}}
						</view>
						<view class="point-address">{{it.cusRealName+'-'+it.cusPhone}}</view>
					</view>
				</view>
			</view>
			<!-- 智能识别 -->
			<view @click="recognition_off_btn" v-if='recognition_off' class="recognition_css">
				<view>识别</view>
				<view>信息</view>

			</view>
			<view v-if='recognition_info_off' class="recognition_view">
				<view style="font-weight: 700;font-size: 40rpx;color: #fff;text-align: center;margin-top: 20rpx;">识别信息
				</view>
				<view>
					<view style="display: flex;justify-content: space-evenly;margin-top: 20rpx;">
						<view style="width: 250rpx;">
							<u-button @click="people_btn(recognition_info)" type="primary">预约人数</u-button>
						</view>
						<view style="width: 250rpx;">
							<u-button @click="car_btn(recognition_info)" type="primary">车型</u-button>
						</view>
					</view>
					<view style="display: flex;justify-content: space-evenly;margin-top: 20rpx;">
						<view style="width: 250rpx;">
							<u-button @click="kehu_btn(recognition_info)" type="primary">联系人</u-button>
						</view>
						<view style="width: 250rpx;">
							<u-button @click="phone_btn(recognition_info)" type="primary">电话</u-button>
						</view>
					</view>
					<view style="display: flex;justify-content: space-evenly;margin-top: 20rpx;">
						<view style="width: 250rpx;">
							<u-button @click="kehubeizhu_btn(recognition_info)" type="primary">驾驶员备注</u-button>
						</view>
						<view style="width: 250rpx;">
							<!-- <u-button @click="mudidi_btn(recognition_info)" type="primary">电话</u-button> -->
						</view>
					</view>



				</view>
				<view style=" width: 80%;margin: auto;margin-top: 30rpx;">
					<u-button @click="recognition_info_off_btn" type="warning">关闭</u-button>
				</view>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		name: "offline-vehicle-dispatch",


		data() {
			return {
				isBaitui_list: [{
						id: 0,
						name: '否',
					},
					{
						id: 1,
						name: '是',
					}
				],
				isBaitui_off: false,
				stationListId: '',
				xiadan_off: 1,
				recognition_info_off: false,
				recognition_off: false,
				recognition_info: {},
				carConfignameList_off: true,
				findComboCusList_data: '',
				curval1: '',
				modal_show: false,
				modalcontent: '',
				bus_list: [],
				stationList: [],
				ceshi: '',
				// 添加多个联系人
				add_people_index: 0,
				add_people_list: [],

				// 客户列表
				findComboCusList_show: false,
				findComboCusList: [],
				// 负责人
				getAllDutyOfCustomList_show: false,
				getAllDutyOfCustomList: [],
				// 业务员
				getServiceMansList_show: false,
				getServiceMansList: [],
				// 指定车型
				needSeats_show: false,
				carConfigname_show: false,
				// {
				// 		id: '0',
				// 		label: '不限车型',
				// 		children: [{
				// 			id: 0,
				// 			label: '',
				// 			children: [{
				// 				id: 0,
				// 				label: ''
				// 			}, ]
				// 		}, ]
				// 	},
				carConfignameList: [],
				needSeatsList: [{
						id: '0',
						label: '不限车型',

					}, {
						id: '5',
						label: '5座',

					}, {
						id: '7',
						label: '7座',

					},
					{
						id: '9',
						label: '9座',

					}, {
						id: '12',
						label: '12座',

					}, {
						id: '14',
						label: '14座',

					}, {
						id: '17',
						label: '17座',

					}, {
						id: '23',
						label: '23座',

					}, {
						id: '30',
						label: '30座',

					}, {
						id: '39',
						label: '39座',

					}, {
						id: '49',
						label: '49座',

					}, {
						id: '55',
						label: '55座',

					},
				],

				// 维修详情输入框样式
				inpBtnStyl: {
					'color': '#00C3CE',
					'padding-right': '30rpx'
				},

				// 表单对象
				fm: {
					fname: 'offlinevehicledispatch',
					sb: {
						load: false,
						text: '添加',
						okBtnSty: {
							'background-color': '#00C3CE',
							'color': '#FFFFFF',
							'margin-left': '10rpx',
							'height': '66rpx',
							'font-size': '30rpx',
							'padding': '0 20rpx',
						},
						cancleBtnSy: {
							'color': '#ff6300',
							'margin-left': '10rpx',
							'height': '66rpx',
							'font-size': '30rpx',
							'padding': '0 20rpx',
						}
					},
					ps2: {
						useCarCompanyname: '',
						useCarDutyUsername: '',
						getServiceMansname: '',
						needSeatsname: '',
						carConfigname: '',
						isBaituiname: '否',
					},
					ps: {
						wayEatPrice: '0',
						isBaitui: '0',
						baituiSignatoryPhone: '',
						riseSignPrice: '0',
						cusMobile: '',
						cusName: '',
						days: '',
						endTime: '',
						flightDate: '',
						flightNum: '',
						flightTime: '',
						fromLocation: '',
						fromLocationData: {
							address: '',
							area: '',
							id: '',
							isSta: '',
							lnglat: '',
							name: '',
							tel: '',
							type: '',
						},
						fromLocationId: '',
						isHighSpeed: '',
						isReturnAdd: false,
						landDate: "",
						needSeats: "",
						priceNeedSeats: "",
						carConfig: '',
						personNum: "",
						persons: [],
						points: [],
						receiveMsg: '',
						remark: '',
						serviceManRemark: '',
						driverRemark: '',
						returnTime: '',
						routeSimpleName: '',
						startTime: '',
						toLocation: '',
						toLocationData: {
							address: '',
							area: '',
							id: '',
							isSta: '',
							lnglat: '',
							name: '',
							tel: '',
							type: '',
						},
						toLocationId: '',
						type: '1',
						useCarCompanyName: '',
						useCarDutyInfo: '',
						useCarDutyUserId: '',

						serviceMan: '',
						userId: '',
						price: '',
						ensureMoney: '',
						regularCarMoney: '',
					},
					// 参数对象


				},
				perfect_info_data: {},
				// 验证对象
				rules: {

					useCarCompanyname: [{
						required: true,
						message: '请选择客户名称',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					useCarDutyUsername: [{
						required: true,
						message: '请输入业务负责人',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					getServiceMansname: [{
						required: true,
						message: '请输入负责人电话',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					personNum: [{
						required: true,
						message: '请输入预约人数',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					// needSeats: [{
					// 	required: true,
					// 	message: '请选择车型',
					// 	// 可以单个或者同时写两个触发验证方式 
					// 	trigger: ['change', 'blur'],
					// }],
					cusName: [{
						required: true,
						message: '请输入乘车人',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
					cusMobile: [{
						required: true,
						message: '请输入乘车人电话',
						// 可以单个或者同时写两个触发验证方式 
						trigger: ['change', 'blur'],
					}],
				},


			}
		},


		mounted() {

		},
		created() {


		},
		onReady() {
			this.$refs.offlinevehicledispatch.setRules(this.rules);
		},
		onLoad(e) {
			let that = this
			that.xiadan_off = 1
			that.perfect_info_data = uni.getStorageSync('perfect_info_data');

			let recognition_remark = uni.getStorageSync('recognition_remark');
			let recognition_info = uni.getStorageSync('recognition_info');
			that.fm.ps.driverRemark = recognition_remark
			that.recognition_info = recognition_info
			if (recognition_remark) {
				that.recognition_off = true
			} else {
				that.recognition_off = false
			}
			let luser = uni.getStorageSync('LUSER');
			// that.fm.ps.userId = luser.userId
			console.log(that.perfect_info_data)
			that.$u.api.findComboCusList({
				page: {
					pageNum: 1,
					pageSize: 9999,
				},
				find: ''
			}).then(res => {
				if (res.code == 1) {
					that.findComboCusList = res.data


				} else {
					that.findComboCusList = []
				}
			})

			that.$u.api.findStationCombo({
				page: {
					pageNum: 1,
					pageSize: 999,
				},
				stationTypes: ['BUS']
			}).then(res => {
				if (res.code == 1) {
					that.bus_list = res.data.list



				}
			})
			that.$u.api.findStationCombo({
				page: {
					pageNum: 1,
					pageSize: 999,
				},
				stationTypes: ['TRAIN', 'BUS', 'AIRPORT']
			}).then(res => {
				if (res.code == 1) {
					that.stationList = res.data.list



				}
			})

			that.$u.api.getServiceMans({

			}).then(res => {
				if (res.code == 1) {
					that.getServiceMansList = res.data



				} else {
					that.getServiceMansList = []
				}
			})
		},
		methods: {
			isBaitui_confirm(e) {
				this.fm.ps2.isBaituiname = e[0].label
				this.fm.ps.isBaitui = e[0].value
			},
			isBaitui_btn(e) {
				let that = this
				that.isBaitui_off = true
			},
			people_btn(e) {
				let that = this
				let info = e.people
				let date = parseInt(info, 10)
				that.fm.ps.personNum = date
			},
			car_btn(e) {
				let that = this
				let info = e.car
				let date = parseInt(info, 10)
				that.fm.ps.price = ''
				that.fm.ps.ensureMoney = ''
				that.fm.ps.regularCarMoney = ''

				let perfect_info_data = that.perfect_info_data
				if (date != 0) {
					that.carConfignameList_off = true
					if (date < Number(that.fm.ps.personNum) + 1) {
						that.fm.ps.needSeats = ''
						that.fm.ps.priceNeedSeats = ''
						that.fm.ps.carConfig = ''
						that.fm.ps2.carConfigname = ''
						that.fm.ps2.needSeatsname = ''
						that.carConfignameList = []
						console.log(date, that.fm.ps.personNum, 'that.fm.ps.personNum')
						return uni.showToast({
							title: "指定车型应大于(预约人数＋司机)",
							icon: "none",
							duration: 1000
						})
					} else {
						that.fm.ps.carConfig = ''
						that.fm.ps2.carConfigname = ''
						that.carConfignameList = []
						that.fm.ps.needSeats = date
						that.fm.ps2.needSeatsname = info

						let stationListId = ''
						if (perfect_info_data.fromLocation.includes('成都天府机场T1') || perfect_info_data.toLocation.includes(
								'成都天府机场T1')) {
							stationListId = 2
						} else if (perfect_info_data.fromLocation.includes('成都天府机场T2') || perfect_info_data.toLocation
							.includes('成都天府机场T2')) {
							stationListId = 3
						} else if (perfect_info_data.fromLocation.includes('成都双流机场T1') || perfect_info_data.toLocation
							.includes('成都双流机场T1')) {
							stationListId = 6
						} else if (perfect_info_data.fromLocation.includes('成都双流机场T2') || perfect_info_data.toLocation
							.includes('成都双流机场T2')) {
							stationListId = 5
						} else if (perfect_info_data.fromLocation=='成都东站' || perfect_info_data.toLocation=='成都东站') {
							stationListId = 4
						} else if (perfect_info_data.fromLocation=='成都南站' || perfect_info_data.toLocation=='成都南站') {
							stationListId = 7
						} else if (perfect_info_data.fromLocation=='成都西站' || perfect_info_data.toLocation=='成都西站') {
							stationListId = 8
						} else if (perfect_info_data.fromLocation=='成都北站' || perfect_info_data.toLocation=='成都北站') {
							stationListId = 9
						} else if (perfect_info_data.routeSimpleName.includes('集合点大巴')) {
							stationListId = 1
						} else if (perfect_info_data.routeSimpleName.includes('包车')) {
							stationListId = 1
						}
						that.stationListId = stationListId
						let lusernum = uni.getStorageSync('LUSER')
						that.$u.api.getCarConfigurationType({
							stationListId: stationListId,
							addWay: '1',
							seats: date,
							companyNum: lusernum.companyNum?lusernum.companyNum:'',
							orderType: perfect_info_data.routeSimpleName.includes('包车') ?'2':'1',
						}).then(res => {

							if (res.code == 1) {
								let data = res.data
								let data_list = []
								for (let i = 0; i < data.length; i++) {
									let obg = {
										id: '',
										text: '',
										val: '',
									}
									obg.id = data[i].id
									obg.text = data[i].text + '(' + data[i].other + ')'
									obg.val = data[i].val
									data_list.push(obg)

								}
								that.carConfignameList = data_list

							} else {
								uni.$u.toast(res.msg);
							}
						})

					}
				} else {
					// console.log(1111, 2222)
					that.carConfignameList_off = false
					that.fm.ps.carConfig = ''
					that.fm.ps2.carConfigname = ''
					that.carConfignameList = []
					that.fm.ps.needSeats = ''
					that.fm.ps.priceNeedSeats = ''
					that.fm.ps2.needSeatsname = e[0].label
				}

			},
			kehu_btn(e) {
				let that = this
				let info = e.kehu
				let date = info
				that.fm.ps.cusName = date
			},
			phone_btn(e) {
				let that = this
				let info = e.phone
				let date = info
				that.fm.ps.cusMobile = date
			},
			kehubeizhu_btn(e) {
				let that = this
				let info = e.kehubeizhu
				let date = info
				that.fm.ps.driverRemark = date
			},
			recognition_off_btn() {
				this.recognition_info_off = !this.recognition_info_off
			},
			recognition_info_off_btn() {
				this.recognition_info_off = false
			},
			onChange() {
				let that = this
				that.$u.api.findComboCusList({
					page: {
						pageNum: 1,
						pageSize: 999,
					},
					find: that.curval1
				}).then(res => {
					if (res.code == 1) {
						that.findComboCusList = res.data


					} else {
						that.findComboCusList = []
					}
				})
			},
			picker_confirm1(e) {
				let that = this

				that.findComboCusList_data = e

				let data = e
				console.log(data)
				that.fm.ps.useCarCompanyName = data.cusCompanySimpleName
				that.fm.ps.userId = data.userId
				that.fm.ps2.useCarCompanyname = data.cusCompanySimpleName + '(' + data.cusPhone + ')'
				that.getAllDutyOfCustomList = []
				if (data.dutyService) {
					let dutyService = data.dutyService.split(',')
					that.fm.ps.useCarDutyUserId = dutyService[0].split('-')[0]
					if (dutyService) {

						that.fm.ps.useCarDutyInfo = dutyService[0].split('-')[0] + '-' + dutyService[0].split('-')[1] +
							'-' + dutyService[0].split('-')[2]
						that.fm.ps2.useCarDutyUsername = dutyService[0].split('-')[1] + '(' + dutyService[0].split(
							'-')[2] + ')'
						for (let i = 0; i < dutyService.length; i++) {
							let dutyService_data = {
								ftUserId: '',
								loginPhone: '',
								realName: '',
							}



							dutyService_data.ftUserId = dutyService[i].split('-')[0]
							dutyService_data.loginPhone = dutyService[i].split('-')[2]
							dutyService_data.realName = dutyService[i].split('-')[1]
							that.getAllDutyOfCustomList.push(dutyService_data)
						}
					} else {
						return uni.showToast({
							title: "出错啦，请联系管理员",
							icon: "none",
							duration: 1000
						})
					}
				} else {
					that.getAllDutyOfCustomList = []
				}

				if (data.serviceMan) {
					console.log(data.serviceMan)
					let serviceMan = data.serviceMan.split(',')
					if (serviceMan) {

						let serviceMan_id = serviceMan[0].split('-')[0]
						for (let i = 0; i < that.getServiceMansList.length; i++) {
							if (serviceMan_id == that.getServiceMansList[i].ftUserId) {
								let data = that.getServiceMansList[i]
								that.fm.ps.serviceMan = data.ftUserId + '-' + data.realName + '-' + data.loginPhone
								that.fm.ps2.getServiceMansname = data.realName + '(' + data.loginPhone + ')'
							}




						}


					} else {
						return uni.showToast({
							title: "出错啦，请联系管理员",
							icon: "none",
							duration: 1000
						})
					}

				}



				that.findComboCusList_show = false
			},
			picker_closeMd(e) {
				this.findComboCusList_show = false
			},
			// 关闭弹框
			closeMd() {
				uni.navigateBack({
					delta: 1
				});
			},
			findComboCusList_btn(e) {
				this.curval1 = ''
				this.findComboCusList_show = true
			},

			getAllDutyOfCustomList_btn(e) {
				this.getAllDutyOfCustomList_show = true
			},
			getAllDutyOfCustomList_confirm(e) {
				let that = this
				for (let i = 0; i < that.getAllDutyOfCustomList.length; i++) {
					if (e[0].value == that.getAllDutyOfCustomList[i].ftUserId) {
						let data = that.getAllDutyOfCustomList[i]

						that.fm.ps.useCarDutyInfo = data.ftUserId + '-' + data.realName + '-' + data.loginPhone
						that.fm.ps2.useCarDutyUsername = data.realName + '(' + data.loginPhone + ')'
					}
				}
			},
			getServiceMansList_btn(e) {
				this.getServiceMansList_show = true
			},
			getServiceMansList_confirm(e) {
				let that = this
				for (let i = 0; i < that.getServiceMansList.length; i++) {
					if (e[0].value == that.getServiceMansList[i].id) {
						let data = that.getServiceMansList[i]
						console.log(data)
						that.fm.ps.serviceMan = data.ftUserId + '-' + data.realName + '-' + data.loginPhone
						that.fm.ps2.getServiceMansname = data.realName + '(' + data.loginPhone + ')'
						// data.ftUserId + '-' + data.realName + '-' + data.loginPhone
					}
				}
			},
			needSeats_btn(e) {
				this.needSeats_show = true
			},
			carConfigname_btn(e) {
				this.carConfigname_show = true
			},
			carConfigname_confirm(e) {
				let that = this
				console.log(e)
				that.fm.ps.carConfig = e[0].value
				that.fm.ps2.carConfigname = e[0].label
				console.log(that.fm.ps.carConfig)
				console.log(that.fm.ps.carConfig)
			},
			needSeats_confirm(e) {
				let that = this
				that.fm.ps.price = ''
				that.fm.ps.ensureMoney = ''
				that.fm.ps.regularCarMoney = ''

				let perfect_info_data = that.perfect_info_data
				if (e[0].value != 0) {
					that.carConfignameList_off = true
					if (e[0].value < Number(that.fm.ps.personNum) + 1) {
						that.fm.ps.needSeats = ''
						that.fm.ps.priceNeedSeats = ''
						that.fm.ps.carConfig = ''
						that.fm.ps2.carConfigname = ''
						that.fm.ps2.needSeatsname = ''
						that.carConfignameList = []
						return uni.showToast({
							title: "指定车型应大于(预约人数＋司机)",
							icon: "none",
							duration: 1000
						})
					} else {
						that.fm.ps.carConfig = ''
						that.fm.ps2.carConfigname = ''
						that.carConfignameList = []
						that.fm.ps.needSeats = e[0].value
						that.fm.ps2.needSeatsname = e[0].label

						let stationListId = ''
						if (perfect_info_data.fromLocation.includes('成都天府机场T1') || perfect_info_data.toLocation.includes(
								'成都天府机场T1')) {
							stationListId = 2
						} else if (perfect_info_data.fromLocation.includes('成都天府机场T2') || perfect_info_data.toLocation
							.includes('成都天府机场T2')) {
							stationListId = 3
						} else if (perfect_info_data.fromLocation.includes('成都双流机场T1') || perfect_info_data.toLocation
							.includes('成都双流机场T1')) {
							stationListId = 6
						} else if (perfect_info_data.fromLocation.includes('成都双流机场T2') || perfect_info_data.toLocation
							.includes('成都双流机场T2')) {
							stationListId = 5
						} else if (perfect_info_data.fromLocation=='成都东站' || perfect_info_data.toLocation=='成都东站') {
							stationListId = 4
						} else if (perfect_info_data.fromLocation=='成都南站' || perfect_info_data.toLocation=='成都南站') {
							stationListId = 7
						} else if (perfect_info_data.fromLocation=='成都西站' || perfect_info_data.toLocation=='成都西站') {
							stationListId = 8
						} else if (perfect_info_data.fromLocation=='成都北站' || perfect_info_data.toLocation=='成都北站') {
							stationListId = 9
						} else if (perfect_info_data.routeSimpleName.includes('集合点大巴')) {
							stationListId = 1
						} else if (perfect_info_data.routeSimpleName.includes('包车')) {
							stationListId = 10
						}
						that.stationListId = stationListId
						let lusernum = uni.getStorageSync('LUSER')
						that.$u.api.getCarConfigurationType({
							stationListId: stationListId,
							addWay: '1',
							seats: e[0].value,
							companyNum: lusernum.companyNum?lusernum.companyNum:'',
							orderType: perfect_info_data.routeSimpleName.includes('包车')  ?'2':'1',
						}).then(res => {

							if (res.code == 1) {
								let data = res.data
								let data_list = []
								for (let i = 0; i < data.length; i++) {
									let obg = {
										id: '',
										text: '',
										val: '',
									}
									obg.id = data[i].id
									obg.text = data[i].text + '(' + data[i].other + ')'
									obg.val = data[i].val
									data_list.push(obg)

								}
								that.carConfignameList = data_list

							} else {
								uni.$u.toast(res.msg);
							}
						})

					}
				} else {
					// console.log(1111, 2222)
					that.carConfignameList_off = false
					that.fm.ps.carConfig = ''
					that.fm.ps2.carConfigname = ''
					that.carConfignameList = []
					that.fm.ps.needSeats = ''
					that.fm.ps.priceNeedSeats = ''
					that.fm.ps2.needSeatsname = e[0].label
				}


			},
			add30Minutes(dateTimeStr) {
				let date = new Date(dateTimeStr);
				date.setMinutes(date.getMinutes() + 30);

				let year = date.getFullYear();
				let month = (date.getMonth() + 1).toString().padStart(2, '0');
				let day = date.getDate().toString().padStart(2, '0');
				let hours = date.getHours().toString().padStart(2, '0');
				let minutes = date.getMinutes().toString().padStart(2, '0');

				let newDateTimeStr = `${year}-${month}-${day} ${hours}:${minutes}`;
				return newDateTimeStr;
			},
			add15Minutes(dateTimeStr) {
				let date = new Date(dateTimeStr);
				date.setMinutes(date.getMinutes() + 30);

				let year = date.getFullYear();
				let month = (date.getMonth() + 1).toString().padStart(2, '0');
				let day = date.getDate().toString().padStart(2, '0');
				let hours = date.getHours().toString().padStart(2, '0');
				let minutes = date.getMinutes().toString().padStart(2, '0');

				let newDateTimeStr = `${year}-${month}-${day} ${hours}:${minutes}`;
				return newDateTimeStr;
			},
			add4hours(dateString) {
				console.log(dateString);
				// 将时间字符串转换为日期对象
				let dateObj = new Date(dateString);

				// 将时间提前4个小时
				dateObj.setHours(dateObj.getHours() - 4);

				// 格式化新的日期时间
				let year = dateObj.getFullYear();
				let month = ("0" + (dateObj.getMonth() + 1)).slice(-2);
				let day = ("0" + dateObj.getDate()).slice(-2);
				let hours = ("0" + dateObj.getHours()).slice(-2);
				let minutes = ("0" + dateObj.getMinutes()).slice(-2);

				let newDateString = year + "-" + month + "-" + day + " " + hours + ":" + minutes;

				console.log(newDateString);
				// 输出新的日期时间字符串
				return newDateString;



			},
			add2hours(dateString) {
				console.log(dateString);
				// 将时间字符串转换为日期对象
				let dateObj = new Date(dateString);

				// 将时间提前4个小时
				dateObj.setHours(dateObj.getHours() - 2);

				// 格式化新的日期时间
				let year = dateObj.getFullYear();
				let month = ("0" + (dateObj.getMonth() + 1)).slice(-2);
				let day = ("0" + dateObj.getDate()).slice(-2);
				let hours = ("0" + dateObj.getHours()).slice(-2);
				let minutes = ("0" + dateObj.getMinutes()).slice(-2);

				let newDateString = year + "-" + month + "-" + day + " " + hours + ":" + minutes;

				console.log(newDateString);
				// 输出新的日期时间字符串
				return newDateString;



			},
			calculate_btn() {
				let that = this
				let perfect_info_data = that.perfect_info_data
				let data = that.fm.ps
				if (!data.useCarCompanyName) {
					return uni.$u.toast('请先选择客户');
				}
				if (!data.useCarDutyInfo) {
					return uni.$u.toast('请先选择负责人');
				}
				if (!data.serviceMan) {
					return uni.$u.toast('请先选择业务员');
				}
				if (!data.personNum) {
					return uni.$u.toast('请先选择预约人数');
				}
				let meetStationId = ''
				if (perfect_info_data.routeSimpleName.includes('集合点大巴') || perfect_info_data.routeSimpleName.includes('包车')) {
					meetStationId = that.bus_list[0].id
				} else {
					meetStationId = ''
				}



				let ps = {
					flightDate: perfect_info_data.flightDate,
					flightNum: perfect_info_data.flightNum,
					fromLocation: perfect_info_data.fromLocation,
					fromLocationData: perfect_info_data.fromLocationData,
					fromLocationId: perfect_info_data.fromLocationId,
					landDate: perfect_info_data.landDate,
					needSeats: data.needSeats,
					priceNeedSeats: '',
					carConfig: data.carConfig,
					personNum: data.personNum,
					routeSimpleName: perfect_info_data.routeSimpleName,
					startTime: perfect_info_data.startTime,
					toLocation: perfect_info_data.toLocation,
					toLocationData: perfect_info_data.toLocationData,
					toLocationId: perfect_info_data.toLocationId,
					userId: data.userId,
					useCarDutyUserId: data.useCarDutyUserId,
					useCarCompanyName: data.useCarCompanyName,
					useCarDutyInfo: data.useCarDutyInfo,
					serviceMan: data.serviceMan,
					type: perfect_info_data.type,
					points: perfect_info_data.points,
					id: '',
					endTime: perfect_info_data.endTime,
					meetStationId: meetStationId,
				}

				that.$u.api.getPrice(ps).then(res => {
					if (res.code == 1) {
						that.fm.ps.price = res.data.price
						that.fm.ps.ensureMoney = res.data.ensureMoney
						that.fm.ps.regularCarMoney = res.data.regularCarMoney
						that.fm.ps.priceNeedSeats = res.data.priceNeedSeats


					} else {
						that.fm.ps.price = ''
						that.fm.ps.priceNeedSeats = ''
						that.fm.ps.ensureMoney = ''
						that.fm.ps.regularCarMoney = ''
						uni.$u.toast(res.msg);
					}
				})
			},

			add_people_btn() {
				if (this.add_people_index < 4) {
					let p = {
						name: '',
						mobile: '',
					}
					this.add_people_list.push(p)
					this.add_people_index += 1


				} else {
					uni.showToast({
						title: "最多添加5个联系人",
						icon: "none",
						duration: 1000
					})
				}
			},
			add_people_delbtn(index) {
				this.add_people_index -= 1
				this.add_people_list.splice(index, 1)
			},
			// modal_show
			modal_confirm(e) {
				this.modal_show = false
				let that = this,
					U = that.U,
					FV = that.FV,
					fm = that.fm,
					data = U.scopy(fm.ps),
					sb = fm.sb;
				that.$refs[fm.fname].validate((valid) => {
					if (!valid) {
						return false;
					} else {
						if (!data.useCarCompanyName) {
							return uni.$u.toast('请先选择客户');
						}
						if (!data.useCarDutyInfo) {
							return uni.$u.toast('请先选择负责人');
						}
						if (!data.serviceMan) {
							return uni.$u.toast('请先选择业务员');
						}
						if (!data.personNum) {
							return uni.$u.toast('请先选择预约人数');
						}
						if (that.fm.ps2.needSeatsname != '不限车型' && that.fm.ps2.needSeatsname != '') {
							if (!data.needSeats) {
								return uni.$u.toast('请先选择指定车型');
							}
						}
						if (!data.price) {
							return uni.$u.toast('请先输入价格');
						}
						if (data.cusMobile.length != 11) {
							return uni.$u.toast('请输入正确的手机号！');
						}

						sb.load = true;
						let perfect_info_data = that.perfect_info_data


						let cusInfo = ''
						if (that.add_people_list.length > 0) {
							let cusInfo_one = {
								name: data.cusName,
								mobile: data.cusMobile
							}
							that.add_people_list.unshift(cusInfo_one)
							let cusInfo_list = []
							for (let i = 0; i < that.add_people_list.length; i++) {
								let cusInfo_data = ''
								if (that.add_people_list[i].name) {
									cusInfo_data = that.add_people_list[i].name + '-' + that.add_people_list[i]
										.mobile
									cusInfo_list.push(cusInfo_data)
								}
							}
							cusInfo = cusInfo_list.join(',')
						} else {
							cusInfo = data.cusName + '-' + data.cusMobile
						}
						that.add_people_list.shift()
						let meetStationId = ''
						if (perfect_info_data.routeSimpleName.includes('集合点大巴')||perfect_info_data.routeSimpleName.includes('包车')) {
							meetStationId = that.bus_list[0].id
						} else {
							meetStationId = ''
						}
						let ps = {
							useDays: perfect_info_data.useDays,
							cusInfo: cusInfo,
							cusMobile: data.cusMobile, // 乘车人电话
							cusName: data.cusName, // 乘车人
							days: '',
							endTime: perfect_info_data.endTime,
							flightDate: perfect_info_data.flightDate,
							flightNum: perfect_info_data.flightNum,
							flightTime: perfect_info_data.flightTime,
							fromLocation: perfect_info_data.fromLocation,
							fromLocationData: {
								address: perfect_info_data.fromLocationData.address,
								area: perfect_info_data.fromLocationData.area,
								id: perfect_info_data.fromLocationData.id,
								isSta: perfect_info_data.fromLocationData.isSta,
								lnglat: perfect_info_data.fromLocationData.lnglat,
								name: perfect_info_data.fromLocationData.name,
								tel: perfect_info_data.fromLocationData.tel,
								type: perfect_info_data.fromLocationData.type,
							}, // 出发地
							fromLocationId: perfect_info_data.fromLocationId,
							isReturnAdd: false,
							landDate: perfect_info_data.landDate,
							needSeats: data.needSeats,
							priceNeedSeats: data.priceNeedSeats,
							carConfig: data.carConfig,
							personNum: data.personNum,
							receiveMsg: data.receiveMsg,
							remark: data.remark,
							serviceManRemark: data.serviceManRemark,
							driverRemark: data.driverRemark,
							returnTime: '',
							routeSimpleName: perfect_info_data.routeSimpleName,
							startTime: perfect_info_data.startTime,
							toLocation: perfect_info_data.toLocation,
							toLocationData: {
								address: perfect_info_data.toLocationData.address,
								area: perfect_info_data.toLocationData.area,
								id: perfect_info_data.toLocationData.id,
								isSta: perfect_info_data.toLocationData.isSta,
								lnglat: perfect_info_data.toLocationData.lnglat,
								name: perfect_info_data.toLocationData.name,
								tel: perfect_info_data.toLocationData.tel,
								type: perfect_info_data.toLocationData.type,
							}, // 目的地
							toLocationId: perfect_info_data.toLocationId,
							userId: data.userId,
							useCarDutyUserId: data.useCarDutyUserId,
							useCarCompanyName: data.useCarCompanyName,
							useCarDutyInfo: data.useCarDutyInfo,
							serviceMan: data.serviceMan,
							type: perfect_info_data.type,
							price: Number(data.price) + Number(data.riseSignPrice) + Number(data.wayEatPrice),
							ensureMoney: data.ensureMoney,
							regularCarMoney: data.regularCarMoney,
							points: perfect_info_data.points,
							persons: that.add_people_list,
							id: '',
							meetStationId: meetStationId,
							wayEatPrice: data.wayEatPrice,
							isBaitui: data.isBaitui,
							baituiSignatoryPhone: data.baituiSignatoryPhone,
							riseSignPrice: data.riseSignPrice,
							returnOrder: null,
						}

						if (ps.needSeats == '0' || ps.needSeats == '') {
							ps.needSeats = null
						}
						if (ps.priceNeedSeats == '0' || ps.priceNeedSeats == '') {
							ps.priceNeedSeats = null
						}

						that.xiadan_off = Number(that.xiadan_off) + 1
						console.log(that.xiadan_off)
						if (that.xiadan_off > 2) {
							return console.log(that.xiadan_off)
						}
						that.$u.api.addOrderByWx(ps).then(res => {
							sb.load = false;
							if (res.code == 1) {
								uni.removeStorageSync('perfect_info_data');
								uni.removeStorageSync('recognition_remark');
								uni.removeStorageSync('recognition_info');
								let tabs_page = {
									tabs1: 3,
								}
								uni.setStorageSync('tabs_page', tabs_page);
								let timer = null
								uni.$u.toast(res.msg);
								clearTimeout(timer)
								timer = setTimeout(() => {
									uni.reLaunch({
										url: '/pages/tabbar/order-list/order-list'
									});
									clearTimeout(timer)
								}, 1000)

							} else {
								U.qerror(res.msg);
							}
						}).catch(err => {
							sb.load = false;
						});
					}
				})
			},
			submitFm(e) {
				let data = this.fm.ps


				// if (data.price <= 0) {
				// 	if (!data.serviceManRemark) {
				// 		return uni.$u.toast('当用车费用为0或负数时，业务员备注不能为空');
				// 	}
				// }

				if (data.needSeats > 0) {
					if (!data.carConfig) {
						return uni.$u.toast('请选择车辆配置');
					}
				}
				let carConfig = ''
				if (data.carConfig == 'ECONOMICAL') {
					carConfig = '经济型'
				} else if (data.carConfig == 'COMFORTABLE') {
					carConfig = '舒适型'
				} else if (data.carConfig == 'LUXURY') {
					carConfig = '豪华型'
				} else if (data.carConfig == 'BUSINESS_NANNY_CAR') {
					carConfig = '商务保姆车'
				} else if (data.carConfig == 'ECONOMICAL_MIDDLE_CAR') {
					carConfig = '经济中巴'
				} else if (data.carConfig == 'COMFORTABLE_MIDDLE_CAR') {
					carConfig = '舒适中巴 '
				} else if (data.carConfig == 'LUXURY_MIDDLE_CAR') {
					carConfig = '豪华中巴 '
				} else if (data.carConfig == 'MIDDLE_NANNY_CAR') {
					carConfig = '中巴保姆车'
				} else if (data.carConfig == 'TRAVEL_LARGE_CAR') {
					carConfig = '旅游大巴'
				} else if (data.carConfig == 'LARGE_NANNY_CAR') {
					carConfig = '大巴保姆车'
				}

				if (data.needSeats) {
					this.modalcontent = '当前创建的是' + data.needSeats + '座车型的' + '(' + carConfig + ')' + data.personNum +
						'人订单，是否继续创建？如需要指定车型请返回选择车型！'
				} else {
					this.modalcontent = '当前创建的是(不限车型)' + data.personNum + '人订单，是否继续创建？如需要指定车型请返回选择车型！'

				}


				this.modal_show = true


			},

		}
	}
</script>

<style lang="scss">
	.recognition_view {
		z-index: 9999;
		position: fixed;
		top: 650rpx;
		left: calc(100vw - 90vw);
		width: 80vw;
		height: 35vh;
		background-color: #a6a6a6;
		border-radius: 8rpx;

	}

	.recognition_css {
		z-index: 8888;
		font-weight: 700;
		font-size: 30rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-wrap: wrap;
		flex-direction: column;
		top: 920rpx;
		right: 10rpx;
		border-radius: 50%;
		width: 120rpx;
		height: 120rpx;
		background-color: #00C3CE;
		position: fixed;
		color: #ffffff
	}

	.picker_css {

		width: 100vw;
		height: 100vh;
		z-index: 9999;
		position: fixed;
		top: 0;
		left: 0;
		background-color: #fff;
	}

	.list-content {
		height: calc(100vh - 150rpx);
		overflow: auto;
		margin-top: 10rpx;

		.point-item {
			border-bottom: 2rpx solid #efefef;
			line-height: 44rpx;
			padding: 10rpx 60rpx 10rpx 20rpx;
			position: relative;

			.point-name {
				display: flex;
				font-weight: 600;
				font-size: 30rpx;
				color: #333;
			}

			.point-address {
				color: #999;
				font-size: 26rpx;
			}

			.point-collect {
				top: calc((100% - 40rpx)/2);
				right: 20rpx;
				position: absolute;
			}
		}
	}
</style>